import React, { Component } from 'react'
import Child from './components/Child'

export default class App extends Component {
  state = {
    age: 18,
  }
  handleClick = () => {
    /* this.setState({
      age: this.state.age + 1,
    }) */
    /* this.setState({
      age: 18,
    }) */
    this.setState({})
  }
  render() {
    return (
      <div>
        App
        <button onClick={this.handleClick}>修改 age</button>
        <hr />
        <Child age={this.state.age} />
      </div>
    )
  }
}
